<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								订单编号：<input type="text" name="orderId"/>
							</li>
							<li>
								商户编号：<input type="text" name="userId"/>
							</li>
							<li>
								是否下发：<select name="bizType" th:with="type=${@dict.getType('jifen_type')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li class="select-time">
								<label>结算日期： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>
							<li>
								<a id="btnSearch"  class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-warning" onclick="$.operate.removeAll()" shiro:hasPermission="system:hatchetAcqJifen:remove">
				分润下发
				</a>
				 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				  
				<font><b>结算总金额：</b><span id="spanSumMoney" > </span>元</font>
				<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:hatchetAcqJifen:export">
						<i class="fa fa-download"></i> 导出
				 </a> -->
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:hatchetAcqJifen:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:hatchetAcqJifen:remove')}]];
        var bizType = [[${@dict.getType('jifen_type')}]];
        var prefix = ctx + "system/hatchetAcqJifen";
        $(function() {
        	//点击总金额清零
        	$("#btnSearch").click(function(){
        		$("#spanSumMoney").text(0);
        	});
            var options = {
                url: prefix + "/list",
				exportUrl: prefix + "/export",
				removeUrl: prefix + "/remove",
                modalName: "积分记录",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'uuid', 
					title : '主键id',
					visible: false
				},
				{
					field : 'orderId', 
					title : '订单号',
					sortable: true
				},
				{
					field : 'userNo', 
					title : '商户编号',
					sortable: true
				},
				{
					field : 'userName', 
					title : '商户名称',
					sortable: true
				},
				{
					field : 'bizType', 
					title : '分润状态',
					align : 'left',
					formatter: function(value, item, index) {
						if(item.sumMoney != null){
	            			$("#spanSumMoney").text(item.sumMoney);
	            		} 
	            		return $.table.selectDictLabel(bizType, item.bizType);
	            	} 
				},
				{
					field : 'product', 
					title : '产品编号',
					sortable: true
				},
				{
					field : 'productName', 
					title : '产品名称',
					sortable: true
				},
				{
					field : 'productAmount', 
					title : '产品金额(元)',
					sortable: true
				},
				{
					field : 'settleType', 
					title : '结算方式（CPA/CPS）',
					sortable: true
				},
				{
					field : 'price', 
					title : '单价',
					sortable: true
				},
				{
					field : 'settleAmount', 
					title : '结算金额(元)',
					sortable: true
				},
				{
					field : 'registerDate', 
					title : '用户注册日期',
					sortable: true
				},
				{
					field : 'settleDate', 
					title : '结算日期',
					sortable: true
				}]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>